//
//  ViewController.m
//  阅读器
//
//  Created by 宋 on 15/12/4.
//  Copyright © 2015年 宋. All rights reserved.
//

#import "ViewController.h"
#import "textViewController.h"
@interface ViewController ()
{
    NSMutableArray * booklist;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"书籍";
    booklist = @[
                 @"我的世界只差一个你",
                 @"你的孤独虽败犹荣",
                 @"花千骨"
                 ].mutableCopy;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return booklist.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * xiao = @"bookstore";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:xiao];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:xiao];
    }
    cell.textLabel.text = booklist[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    textViewController * con = [[textViewController alloc] initWithStyle:UITableViewStyleGrouped];
    [self.navigationController pushViewController:con animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
